var app = angular.module('app').config(function($controllerProvider,
                                                $compileProvider, $filterProvider,
                                                $provide){
    app.controller = $controllerProvider.register;
    app.directive = $compileProvider.directive;
    app.filter = $filterProvider.register;
    app.factory = $provide.factory;
    app.service = $provide.service;
    app.constant = $provide.constant;
    app.value = $provide.value;

});

app.config(function($breadcrumbProvider){
    $breadcrumbProvider.setOptions({
        template : '<ul class="breadcrumb"><li ng-repeat="step in steps" ng-class="{active: $last}" ng-switch="$last || !!step.abstract"><a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}">{{step.ncyBreadcrumbLabel}}</a><span ng-switch-when="true">{{step.ncyBreadcrumbLabel}}</span></li></ul>'
    });
});

app.config(function($httpProvider){
    //$httpProvider.defaults.headers.common.Authorization = 'bearer ' + sessionStorage.getItem('accessToken');

    //添加跨域请求，告诉AngularJS使用XDomain，把所有的请求中把X-Request-With头移除掉
    $httpProvider.defaults.useXDomain = true;
    delete $httpProvider.defaults.headers.common['X-Requested-With'];
    //添加 一个请求拦截器，方便注入 token
    $httpProvider.interceptors.push('HttpInterceptor');
});
/**
 * 设置RestangularProvider
 */
app.config(function(RestangularProvider){
    // 基础路由
    RestangularProvider.setBaseUrl('http://10.10.10.182');
});


